#include "settingwindow.h"
#include "settingctl.h"
#include "graphicsPanel.h"
#include "mainwindow.h"

SettingWindow::SettingWindow(MainWindow *parent) : QDialog(parent),
Ui::frame()
{
  setupUi(this);


  // Ctl_1 setup
  ctl_1 = new SettingCtl(this,parent->getGraphicsPanel(1),1);
  ctl_1->setCtlpanel(
                     exec_1,
                     comboAlign_11,
                     comboAlign_12,
                     lineEdit_1x,
                     lineEdit_1y,
                     lineEdit_1w,
                     lineEdit_1h,
                     _bgc_1,
                     _fgc_1,
                     comboPtn_1,
                     lineEdit_size_1,
                     lineEdit_scale_1x,
                     lineEdit_scale_1y,
                     lineEdit_rotay_1
                 	);
  // Ctl_1 end

  // Ctl_2 setup
  ctl_2 = new SettingCtl(this,parent->getGraphicsPanel(2),2);
  ctl_2->setCtlpanel(
                     exec_2,
                     comboAlign_21,
                     comboAlign_22,
                     lineEdit_2x,
                     lineEdit_2y,
                     lineEdit_2w,
                     lineEdit_2h,
                     _bgc_2,
                     _fgc_2,
                     comboPtn_2,
                     lineEdit_size_2,
                     lineEdit_scale_2x,
                     lineEdit_scale_2y,
                     lineEdit_rotay_2
                 	);
  // Ctl_2 end

  // Ctl_3 setup
  ctl_3 = new SettingCtl(this,parent->getGraphicsPanel(3),3);
  ctl_3->setCtlpanel(
                     exec_3,
                     comboAlign_31,
                     comboAlign_32,
                     lineEdit_3x,
                     lineEdit_3y,
                     lineEdit_3w,
                     lineEdit_3h,
                     _bgc_3,
                     _fgc_3,
                     comboPtn_3,
                     lineEdit_size_3,
                     lineEdit_scale_3x,
                     lineEdit_scale_3y,
                     lineEdit_rotay_3
                 	);
  // Ctl_3 end	
  
  // Ctl_4 setup
  ctl_4 = new SettingCtl(this,parent->getGraphicsPanel(4),4);
  ctl_4->setCtlpanel(
                     exec_4,
                     comboAlign_41,
                     comboAlign_42,
                     lineEdit_4x,
                     lineEdit_4y,
                     lineEdit_4w,
                     lineEdit_4h,
                     _bgc_4,
                     _fgc_4,
                     comboPtn_4,
                     lineEdit_size_4,
                     lineEdit_scale_4x,
                     lineEdit_scale_4y,
                     lineEdit_rotay_4
                 	);
  // Ctl_4 end  

  // Ctl_5 setup
  ctl_5 = new SettingCtl(this,parent->getGraphicsPanel(5),5);
  ctl_5->setCtlpanel(
                     exec_5,
                     comboAlign_51,
                     comboAlign_52,
                     lineEdit_5x,
                     lineEdit_5y,
                     lineEdit_5w,
                     lineEdit_5h,
                     _bgc_5,
                     _fgc_5,
                     comboPtn_5,
                     lineEdit_size_5,
                     lineEdit_scale_5x,
                     lineEdit_scale_5y,
                     lineEdit_rotay_5
                 	);
  // Ctl_5 end

  // Ctl_6 setup
  ctl_6 = new SettingCtl(this,parent->getGraphicsPanel(6),6);
  ctl_6->setCtlpanel(
                     exec_6,
                     comboAlign_61,
                     comboAlign_62,
                     lineEdit_6x,
                     lineEdit_6y,
                     lineEdit_6w,
                     lineEdit_6h,
                     _bgc_6,
                     _fgc_6,
                     comboPtn_6,
                     lineEdit_size_6,
                     lineEdit_scale_6x,
                     lineEdit_scale_6y,
                     lineEdit_rotay_6
                 	);
  // Ctl_6 end

  // Ctl_7 setup
  ctl_7 = new SettingCtl(this,parent->getGraphicsPanel(7),7);
  ctl_7->setCtlpanel(
                     exec_7,
                     comboAlign_71,
                     comboAlign_72,
                     lineEdit_7x,
                     lineEdit_7y,
                     lineEdit_7w,
                     lineEdit_7h,
                     _bgc_7,
                     _fgc_7,
                     comboPtn_7,
                     lineEdit_size_7,
                     lineEdit_scale_7x,
                     lineEdit_scale_7y,
                     lineEdit_rotay_7
                 	);
  // Ctl_7 end

  // Ctl_8 setup
  ctl_8 = new SettingCtl(this,parent->getGraphicsPanel(8),8);
  ctl_8->setCtlpanel(
                     exec_8,
                     comboAlign_81,
                     comboAlign_82,
                     lineEdit_8x,
                     lineEdit_8y,
                     lineEdit_8w,
                     lineEdit_8h,
                     _bgc_8,
                     _fgc_8,
                     comboPtn_8,
                     lineEdit_size_8,
                     lineEdit_scale_8x,
                     lineEdit_scale_8y,
                     lineEdit_rotay_8
                 	);
  // Ctl_8 end

	
	
	
	
  QObject::connect(Quit, SIGNAL(clicked()), this, SLOT(slotWindowClose()));


}

void SettingWindow::slotWindowClose()
{
  delete ctl_1;
  delete ctl_2;
  delete ctl_3;
  delete ctl_4;
  delete ctl_5;
  delete ctl_6;
  delete ctl_7;
  delete ctl_8;

  close();


}

